#include <iostream>
#include <string>

using namespace std;
int main()
{



	int m_bookCode = 0;
	double m_copyPrice = 0.00;
	int m_numberOnHand = 0;
	int m_prospactiveEnrollment = 0;
	bool m_required = 0;
	bool m_newUsed = 0;
	int m_order;
	double m_total = 0.00;
	char loop = ' ';
	do 
	{
		cout<<"Please enter the book code: ";cin>>m_bookCode;
		cout<<"single copy price: ";cin>>m_copyPrice;
		cout<<"number on hand: ";cin>>m_numberOnHand;
		cout<<"prospective enrollment: ";cin>>m_prospactiveEnrollment;
		cout<<"1 for required/ 0 for optional: ";cin>>m_required;
		cout<<"1 for new/ 0 for used: ";cin>>m_newUsed;

		cout<<"***********************************************"<<endl;

		cout<<"Book: "<<m_bookCode<<endl;
		cout<<"Price: $"<<m_copyPrice<<endl;
		cout<<"Inventory: "<<m_numberOnHand<<endl;
		cout<<"Enrollment: "<<m_prospactiveEnrollment<<endl;

		if(m_required == 1 && m_newUsed == 1)
		{
			cout<<"This book is required and new."<<endl;
		}
		else if (m_required == 1 && m_newUsed == 0)
		{
			cout<<"This book is required and used."<<endl;
		}
		else if (m_required == 0 && m_newUsed == 1)
		{
			cout<<"This book optional and new."<<endl;
		}
		else if (m_required == 0 && m_newUsed == 0)
		{
			cout<<"This book optional and used."<<endl;
		}

		cout<<"***********************************************"<<endl;

		cout<<"Need to order:  ";cin>>m_order;
		m_total = m_order * m_copyPrice;
		cout<<"Total Cost: "<<m_total<<endl;

		cout<<"***********************************************"<<endl;

		cout<<"Total for all orders: "<<m_total<<endl;
		cout<<"Profit: $"<<m_total*0.2<<endl;

		cout<<"Enter 1 to do another book, 0 to stop: ";
		cin>>loop;
	} while (loop != '0');


	system("pause");
}